#pragma once

#include "DXAMLCommon.h"


#include "XamlType.h"
#include "XamlProperty.h"
#include "XamlNamespace.h"


class XamlParserFrame
{
public:
	enum ElementKind
	{
		ekNone = 0x0,
		ekEmptyElement = 0x1,
		ekElement = 0x2,
		ekPropertyElement = 0x3
	};
private: 
	xshared_ptr<XamlType> m_Type;
	xshared_ptr<XamlType> m_PreviousChildType;
	xshared_ptr<XamlProperty> m_Member;
	xshared_ptr<xstringmap<xshared_ptr<XamlNamespace> > > m_Namespaces;
	enum ElementKind m_ElementKind;
	struct  
	{
		XUINT32 m_bInPropertyElement:1;
		XUINT32 m_bSeenRealProperties:1;
		XUINT32 m_bInItemsProperty:1;
		XUINT32 m_bInInitProperty:1;
		XUINT32 m_bInUnknownContent:1;
		XUINT32 m_bInCollectionFromMember:1;
		XUINT32 m_bInImplicitContent:1;
		XUINT32 m_bParentIsPropertyElement:1;
	};


public: 
	XamlParserFrame();
	void SetNamespaces(const xshared_ptr<xstringmap<xshared_ptr<XamlNamespace> > > & inNamespaces);
	enum XamlParserFrameKind get_ElementKind() const;
	void set_ElementKind(const enum ElementKind & inCurrentKind);

	const xshared_ptr<XamlType> & get_Type() const;
	void set_Type(const xshared_ptr<XamlType> & inType);

	XBOOL get_SeenRealProperties() const;
	void set_SeenRealProperties(const XBOOL & bSeenRealProperties);

	const xshared_ptr<XamlType> & get_PreviousChildType() const;
	void set_PreviousChildType(const xshared_ptr<XamlType> & inPreviousChildType);

	XBOOL get_InItemsProperty() const;
	void set_InItemsProperty(XBOOL bInItemsProperty);

	const xshared_ptr<XamlProperty> & get_Member() const;
	void set_Member(const xshared_ptr<XamlProperty> & inMember);

	XBOOL get_InInitProperty();
	void set_InInitProperty(const XBOOL & bInInitProperty);

	XBOOL get_InUnknownContent() const;
	void set_InUnknownContent(const XBOOL bInUnknownContent);

	XBOOL get_InPropertyElement() const;
	void set_InPropertyElement(const XBOOL & bInPropertyElement);

	XBOOL get_InCollectionFromMember() const;
	void set_InCollectionFromMember(const XBOOL & bInCollectionFromMember);

	XBOOL get_InImplicitContent() const;
	void set_InImplicitContent(const XBOOL & bInImplicitContent);

	XBOOL get_ParentIsPropertyElement();
	void set_ParentIsPropertyElement(const XBOOL & bParentIsPropertyElement);

	HRESULT GetNamespaceByPrefix(const xshared_ptr<CXString> & inPrefix, xshared_ptr<XamlNamespace> & outNamespace) const;



};

